<!--河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
-->
<template>
  <div>
    <el-form ref="form" :model="t_step" :rules="rules" label-width="100px" id="mvcfm">
      <div class="form-unit">
        <span class="mvc-title-left"> 检测项目详情 </span>
      </div>
      <div>
        <el-row>
          <el-col :span="24">
            <el-form-item label="检测项目" prop="">
              {{t_step.description}}
            </el-form-item>
          </el-col>
        </el-row>
      </div>
      <el-button @click="gotoPage('&cpopup=reload'+vueparams+'')" type='primary' size="mini">关联下一步</el-button>
      <div class="form-unit">
        <span class="mvc-title-left"> 下一步 </span>
      </div>
      <el-table :data="s_skip">
        <el-table-column label="增加下一步" prop="">
          <template slot-scope="scope">
            <el-button @click="popAddTestingItemsNext('')" type='success' size="mini"><i class='fa fa-plus'></i>增加下一步</el-button>
          </template>
        </el-table-column>
        <el-table-column label="#" align="center" type='index'>
        </el-table-column>
        <el-table-column label="操作" prop="" width="50">
          <template slot-scope="scope">
            <a href="javascript:mvc.submitURL('gotoPage('/xcapi/VUEAction/mes/product/TechnologyAction/d_skip?CMIDskipid='+scope.row.skipid+'')')" type='danger'>{{scope.row['']}}</a>
          </template>
        </el-table-column>
        <el-table-column label="下一步" prop="description">
        </el-table-column>
      </el-table>
    </el-form>
    <el-dialog :visible.sync="AddTestingItemsNextVisible" append-to-body>
      <AddTestingItemsNext v-if="AddTestingItemsNextVisible" ref="AddTestingItemsNext" :popparams="popparams"> </AddTestingItemsNext>
    </el-dialog>
  </div>
</template>
<script>
  import request from '@/utils/request'
  import AddTestingItemsNext from "@/views/mes/product/AddTestingItemsNext";
  export default {
    name: 'TestingItemsStandMang',
    components: {
      AddTestingItemsNext,
    },
    props: ['popparams'],
    data() {
      return {
        AddTestingItemsNextVisible: false,
        AddTestingItemsNextValue: null,
        AddTestingItemsNextDesc: null,
        vueparams: this.getVUEParams(""),
        t_step: {
          description: null,
        },
        s_skip: [],
        loading: false,
        rules: {}
      }
    },
    created() {
      this.getData();
    },
    updated() {},
    mounted() {},
    methods: {
      getData() {
        request({
          method: 'get',
          url: '/xcapi/VUEAction/mes/product/TechnologyAction/testingItemsStandMang?' + this.vueparams,
        }).then(data => {
          for (var k in data) {
            if (Array.isArray(data[k])) {
              this[k] = data[k];
            } else {
              $.extend(this[k], data[k]);
            }
          }
        })
      },
      popAddTestingItemsNext(params) {
        if (params != "") this.popparams = params + this.vueparams;
        this.AddTestingItemsNextVisible = !this.AddTestingItemsNextVisible;
      },
    },
  }
</script>
